above Create move
Code:

//Just looks nicer :P
int cWeaponPistol()
{
   return(currentWeaponID>=WEAPON_USP && currentWeaponID<=WEAPON_FIVE7);
}


now in createmove

Code:

   if(!me.iClip && usercmd->buttons&IN_ATTACK)
   {
                 //////////////////////////
                // if your a noob you need this
      static bool domeonce = true;
      if(domeonce == true)
      {
         domeonce = false;
         pEngfuncs->pfnClientCmd("hud_fastswitch 1");
      }/////////////////////////

      if(cWeaponPistol())
      {
         cmd.exec("#slot1");
      } else {
         cmd.exec("#slot2");
      }
   } 